import type { XtxGuessInstance } from '@/types/component'
import { throttle } from 'lodash'
import { ref } from 'vue'

export const useGuessList = () => {
  //拿到猜你喜欢组件实例
  const guessRef = ref<XtxGuessInstance>()
  //滚动触底的回调函数
  const onScrolltolower = throttle(() => {
    //调用子组件的请求函数
    guessRef.value?.getMore()
  }, 1000)
  return {
    guessRef,
    onScrolltolower,
  }
}
